﻿<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>jQuery拖动滑块图片拼图验证码插件</title>

<!--框架样式-->
<link href="css/bootstrap.min.css" rel="stylesheet">

<!--图标样式-->
<link href="https://cdn.bootcss.com/font-awesome/5.7.2/css/all.min.css" rel="stylesheet">

<!--主要样式-->
<link href="disk/slidercaptcha.css" rel="stylesheet" />

<style>
.slidercaptcha {
	margin: 0 auto;
	width: 314px;
	height: 286px;
	border-radius: 4px;
	box-shadow: 0 0 10px rgba(0, 0, 0, 0.125);
	margin-top: 40px;
}

.slidercaptcha .card-body {
	padding: 1rem;
}

.slidercaptcha canvas:first-child {
	border-radius: 4px;
	border: 1px solid #e6e8eb;
}

.slidercaptcha.card .card-header {
	background-image: none;
	background-color: rgba(0, 0, 0, 0.03);
}

.refreshIcon {
	top: -54px;
}
</style>

</head>
<body>

<div class="container-fluid">
	<div class="form-row">
		<div class="col-12">
			<div class="slidercaptcha card">
				<div class="card-header">
					<span>请完成安全验证</span>
				</div>
				<div class="card-body"><div id="captcha"></div></div>
			</div>
		</div>
	</div>
</div>

<script src="js/jquery-1.11.0.min.js" type="text/javascript"></script>
<script src="disk/longbow.slidercaptcha.js"></script>
<!-- http://www.bluestep.cc/jquery插件-兼容移动端滑块滑动表单安全验证码jquery插件/ -->
<script>
	$('#captcha').sliderCaptcha({
		width: 280,
        height: 150,
        sliderL: 42,//拼图宽度
        sliderR: 9,//拼图突出半径
        offset: 5,//验证容错偏差值 默认5个像素偏差即认为验证通过
        loadingText: '正在加载中...',//	图片加载时显示的文本信息
        failedText: '再试一次',
        barText: '向右滑动填充拼图',
        repeatIcon: 'fa fa-redo',
		setSrc: function () {
			//return 'http://images.sdgxgz.com/Pic' + Math.round(Math.random() * 136) + '.jpg';
			return  'img/1.jpg';
		},
		onSuccess: function () {

			alert('验证通过!');
		},
		onFail: function () {

        },
        onRefresh: function () {
        
        }
	});
</script>
<div style="text-align:center;margin:50px 0; font:normal 14px/24px 'MicroSoft YaHei';">
<p>适用浏览器：360、FireFox、Chrome、Opera、傲游、搜狗、世界之窗. 不支持Safari、IE8及以下浏览器。</p>
<p>来源：<a href="https://www.lanrenzhijia.com/" target="_blank">懒人</a></p>
</div>
</body>
</html>